﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Danhmucsanpham : System.Web.UI.Page
{
    DanhmucsanphamController danhmucsanphamController = new DanhmucsanphamController();
    protected void Page_Load(object sender, EventArgs e)
    {
        grvDanhmucsanpham.DataSource = danhmucsanphamController.GetAll();
        grvDanhmucsanpham.DataBind();

        if (grvDanhmucsanpham.Rows.Count > 0)
        {
            grvDanhmucsanpham.UseAccessibleHeader = true;
            grvDanhmucsanpham.HeaderRow.TableSection = TableRowSection.TableHeader;
        }
    }
    [WebMethod]
    public static string deleteDanhmucsanpham(int danhmuc_id)
    {
        DanhmucsanphamController danhmucsanphamController = new DanhmucsanphamController();
        if (danhmucsanphamController.Delete(danhmuc_id) > 0)
        {
            return "true";
        }
        else
        {
            return "false";
        }
    }
}